package com.korion.kdyassistant.base

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.korion.kdyassistant.ui.MainActivity




class AutoBootReceiver: BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        //开机启动
        if (intent.action == Intent.ACTION_BOOT_COMPLETED) {
            val thisIntent = Intent(context, MainActivity::class.java) //设置要启动的app
            thisIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
            context.startActivity(thisIntent)
        }
    }
}